include $(C2C_BASE_PATH)/comm/makefile.comm.v2

INSTALL_PATH = /data/rpm_data_64bit/b2b2c/b2b2c_dao_cooperator_write_1/build_directory/usr/local/c2csvc/so/
INSTALL_PATH1 = /data/rpm_data_64bit/b2b2c/b2b2c_dao_cooperator_read_1/build_directory/usr/local/c2csvc/so/
INCLUDE = -I../include \
		  -I../src \
		  -I$(C2C_BASE_PATH)/item/export_include/ \
		  -I$(C2C_BASE_PATH)/comm/export_include/ \
		  -I$(C2C_BASE_PATH)/comm/export_include/ \
		  -I$(C2C_BASE_PATH)/comm/export_include/c2cplatform \
		  -I$(C2C_BASE_PATH)/comm/export_include/app_platform \
		  -I$(C2C_BASE_PATH)/comm/export_include/tlib \
		  -I$(C2C_BASE_PATH)/comm/export_include/libc2c \
		  -I$(C2C_BASE_PATH)/auction_comm/export_include \
		  -I$(C2C_BASE_PATH)/b2b2c_comm/export_include/b2b2c/comm \
		  -I$(INC_B2B2CCOMM_PATH) \
			$(INC_MYSQL) 

LIB = -L$(LIB_EXPORT_PATH) $(B2B2C_TMEM_LIB) -llibrary_the3_itil -L/usr/lib64 -lcrypto -lstorage_mysql -lcomponent_dal_set \
		-llibrary_log2 -llogclient -llibrary_xml -llibrary_the3_tinyxml -llibrary_algorithm \
		-ldl -ltlib $(LIB_MYSQL) -lxml2 -lz -lm -llibrary_util \
	  -lres_factory -llibrary_log2 -llibrary_util \
	   -ldb_conn_pool -llibrary_db -llibrary_net $(CONSISTENTHASH_LIB) \
	  $(CFGCENTER_SET_LIB) -llibrary_module_invoke_api -llibrary_sys -llibrary_the3_tconv \
	  -lcomponent_configcenter_4cgi_multiport -llogclient -lc2c \
	  -lcomponent_sess_sync_push -lcomponent_online_sess_check \
	  -lcomponent_msgq_producer -llibrary_log2 -llogclient $(TINY_XML_LIB) \

CPPFLAGS += -D_B2B2C_ITEM_DEBUG_

OUTPUT = dao_cooperator_write.so
OUTPUT1 = dao_cooperator_read.so

VPATH = ../lib

SOURCES = cooperatordao_adaptor.cpp \
		cooperator_db_operator.cpp \
		cooperatordao.cpp 
OBJECTS=$(SOURCES:.cpp=.o)

all:$(OUTPUT) 

.SUFFIXES: .o .cpp
.cpp.o:
	$(CXX) $(CPPFLAGS) $(INCLUDE) -c $(filter %.cpp, $^) 

.o:
	$(CXX) $(CPPFLAGS) $(INCLUDE) -o $@ $^ 

$(OUTPUT): $(OBJECTS)
	$(CXX) $(CFLAGS) -fPIC -shared -o $@ $^ $(LIB)
	cp $(OUTPUT) $(OUTPUT1) -v
clean:
	rm -f *.o *.so *.~ *.bak

install:
	cp -f $(OUTPUT) $(INSTALL_PATH)
	cp -f $(OUTPUT1) $(INSTALL_PATH1)

dep:
	mkdep -p$(VPATH) $(INCLUDE) $(SOURCES) > .depend

ifneq ($(wildcard .depend),)
include .depend
endif
